// components/performance/index.js
 
import {
  useToast
} from '../../miniprogram_npm/miniprogram-vc-components/toast/useToast';
 
const form = {
  siliconAluminiumRatio: {
    type: '硅铝比',
    value: '',
    rep: '硅铝比 = 硅/铝'
  },
  qualityCoefficientOfExpansion: {
    type: '质量分数膨胀系数',
    value: '',
    rep: '质量分数膨胀系数(所有质量分数膨胀系数之和)'
  },
  mooreCoefficientOfExpansion: {
    type: '摩尔成分膨胀系数',
    value: '',
    rep: '摩尔成分膨胀系数(所有摩尔成分膨胀系数之和)'
  },

  initTemperature: {
    type: '始融温度',
    value: '',
    rep: '始融温度 = ( ( 10* m +n )/2 -x )*y +z'
  },
  firingTemperature: {
    type: '烧成温度',
    value: '',
    rep: '烧成温度 = 熔融温度 + 修正量'
  },
  highTemperatureViscosity: {
    type: '高温黏度',
    value: '',
    rep: '高温黏度 = Log(920/(kz-0.32),10)'
  },
  surfaceTension: {
    type: '表面张力',
    value: '',
    rep: '表面张力 = \n sum(Y900)-0.04(Tg(配方的烧成温度)-900) \n 高温粘度为0时，该值无意义'
  }
  // kz: {
  //   type: '粘度系数',
  //   value: '',
  //   rep: '粘度系数Kz = \n(100/(氧化硅质量分数+氧化质铝氧化铝量分数))-1'
  // },
  // meltingTemperature: {
  //   type: '熔融温度',
  //   value: '',
  //   rep: '熔融温度 = (m-0.35)*125 + (n-3)*12.5 +1250'
  // }
};
Component({
  /**
   * 组件的属性列表
   */
  properties: {
     dataSource: {
       type: Object,
       value: {},
       observer(data){
         this.setData(data)
       }
     },
     show: {
       type: Boolean,
       value: false
     }
  },

  /**
   * 组件的初始数据
   */
  data: {
    tRongCorrectionValue: '',
    x: '',
    y: '',
    z: '',
    activeName: '',
    fields: Object.keys(form),
    form,
    showMore: false,
    computedProps: {} 
  },

  /**
   * 组件的方法列表
   */
  methods: {
 
    switchItem(event) {
      this.setData({
        activeName: event.detail,
      });
    },
    showMoreHandle() {
      this.setData({
        showMore: !this.data.showMore
      })
    },
 
    onClose(){
      this.triggerEvent('close')
    },
  },
  lifetimes: {
    attached() {
 
    }
  }
})